package com.kuaifawu.lwnlawyerclient.Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageButton;

import com.kuaifawu.lwnlawyerclient.R;
import com.umeng.analytics.MobclickAgent;

/**
 * Created by wyk123 on 2015/7/17.
 */
public class LWNLogin_Join extends Activity {
    private ImageButton skip_back;
    private WebView skip_webview;
    private String skipUrl="";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_join);
        //https://www.baidu.com/?tn=87048150_2_dg
        Intent intent=getIntent();
        Bundle bundle=intent.getExtras();
        skipUrl=bundle.getString("skipurl");

        inItView();
        skipWeb(skipUrl);


    }
    private void inItView(){
        skip_webview=(WebView)findViewById(R.id.skip_webview);
        skip_back=(ImageButton)findViewById(R.id.skip_back);

        skip_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }
    private void skipWeb(String url){
        skip_webview.loadUrl(url);
        WebSettings settings=skip_webview.getSettings();
        settings.setJavaScriptEnabled(true);
        skip_webview.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

    }
    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onPageStart("SplashScreen");
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd("SplashScreen");
        MobclickAgent.onPause(this);
    }


}
